package com.zx.oa.utils;

/**
 * 存放页面信息的对象
 *
 */
public class PageSupport {

    public  static  final int pageSizeVal=5;//页面尺寸常量！

    private  int currentPageNo=1;//当前页号
    private  int pageSize;//页面的尺寸(一页显示几条数据)
    private  int totalCount;//总记录数
    private  int totalPageCount;// 总页面数

    public int getCurrentPageNo() {
        return currentPageNo;
    }

    public void setCurrentPageNo(int currentPageNo) {
        this.currentPageNo = currentPageNo;
    }

    public int getPageSize() {
        return pageSize;
    }

    public void setPageSize(int pageSize) {
        this.pageSize = pageSize;
    }

    public int getTotalCount() {
        return totalCount;
    }

    public void setTotalCount(int totalCount) {
        this.totalCount = totalCount;
        //获得总页面的逻辑：如果总记录数不能整除页面尺寸，就在总记录数/页面尺寸基础上新增一页
        this.totalPageCount=
          this.totalCount%this.pageSize==0?this.totalCount/this.pageSize:this.totalCount/this.pageSize+1;
    }

    public int getTotalPageCount() {
        return totalPageCount;
    }

    public void setTotalPageCount(int totalPageCount) {
        this.totalPageCount = totalPageCount;
    }
}
